//
//@File    :	5.18_textin3.cpp
//@Time    :	2021/08/06 18:13:52
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	reading chars to end of file
//

#include <iostream>

using namespace std;
int main()
{
    char ch;
    int count = 0;
    cin.get(ch);
    while (cin.fail() == false)
    {
        cout << ch;
        ++count;
        cin.get(ch);
    }
    cout << endl
         << count << " characters read\n";
    system("pause");
    return 0;
}